import os

import yaml


class Utils:
    @classmethod
    def root_path(cls):
        '''
        获取项目跟路径
        :return:
        '''
        return os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

    @classmethod
    def read_yaml(cls, file_path):
        '''
        读取yaml
        :param file_path:
        :return:
        '''
        with open(file_path, encoding='utf-8') as f:
            return yaml.safe_load(f)
